home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 3006 / 3006.xpi / chrome / dwhelper.jar / content / dump-media.xul < prev    next >
Extensible Markup Language  |  2010-01-15  |  3KB  |  96 lines

  1. <?xml version="1.0"?> 
  2. <!-- *****************************************************************************
  3.  *            Copyright (c) 2006-2009 Michel Gutierrez. All Rights Reserved.
  4.  ****************************************************************************** -->
  5. <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
  6.  
  7. <!DOCTYPE dialog SYSTEM "chrome://dwhelper/locale/dwhelper.dtd" >
  8.  
  9. <dialog id="dwhelper-dump-media"
  10.         title="&title.media-dump;"
  11.         flex="1"
  12.         onload="onLoad()"
  13.         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  14.         xmlns:html="http://www.w3.org/1999/xhtml"
  15.         buttons="accept">
  16.         
  17.     <html:style>
  18. tree {
  19.     width: 450px;
  20.     height: 250px;
  21. }
  22.     </html:style>
  23.  
  24.     <script><![CDATA[
  25. var Util=Components.classes["@downloadhelper.net/util-service;1"]
  26.     .getService(Components.interfaces.dhIUtilService);
  27.  
  28. function buildTreeChildren(entry,tree) {
  29.     var treechildren=document.createElement("treechildren");
  30.     tree.appendChild(treechildren);
  31.     var keys=entry.getKeys({});
  32.     for(var i in keys) {
  33.         var key=keys[i];
  34.         var treeitem=document.createElement("treeitem");
  35.         treechildren.appendChild(treeitem);
  36.         var treerow=document.createElement("treerow");
  37.         treeitem.appendChild(treerow);
  38.         var treecell=document.createElement("treecell");
  39.         treerow.appendChild(treecell);
  40.         treecell.setAttribute("label",key);
  41.         var value=Util.getPropsString(entry,key);
  42.         if(value) {
  43.             treecell=document.createElement("treecell");
  44.             treerow.appendChild(treecell);
  45.             treecell.setAttribute("label",value);
  46.         } else {
  47.             try {
  48.                 var array=entry.get(key,Components.interfaces.nsIArray);
  49.                 treeitem.setAttribute("container","true");
  50.                 treeitem.setAttribute("open","true");
  51.                 var treechildren1=document.createElement("treechildren");
  52.                 treeitem.appendChild(treechildren1);
  53.                 var j=array.enumerate();
  54.                 var index=0;
  55.                 while(j.hasMoreElements()) {
  56.                     var item=j.getNext().QueryInterface(Components.interfaces.nsIProperties);
  57.                     var treeitem1=document.createElement("treeitem");
  58.                     treeitem1.setAttribute("container","true");
  59.                     treeitem1.setAttribute("open","true");
  60.                     treechildren1.appendChild(treeitem1);
  61.                     var treerow1=document.createElement("treerow");
  62.                     treeitem1.appendChild(treerow1);
  63.                     var treecell1=document.createElement("treecell");
  64.                     treerow1.appendChild(treecell1);
  65.                     treecell1.setAttribute("label",""+index);
  66.                     buildTreeChildren(item,treeitem1);
  67.                     index++;
  68.                 }
  69.             } catch(e) {
  70.                 treecell=document.createElement("treecell");
  71.                 treerow.appendChild(treecell);
  72.                 treecell.setAttribute("label","...");
  73.             }
  74.         }
  75.     }
  76. }
  77.  
  78. function onLoad() {
  79.     var tree=document.getElementById("entry");
  80.     var entry=window.arguments[0];
  81.     buildTreeChildren(entry,tree);
  82.     window.sizeToContent();
  83. }
  84.  
  85. ]]>
  86.     </script>
  87.  
  88.     <tree id="entry" flex="1" hidecolumnpicker="true" editable="true">
  89.         <treecols>
  90.             <treecol id="prop-name" label="&label.dump-media.prop-name;" flex="1" primary="true" />  
  91.             <treecol id="prop-value" label="&label.dump-media.prop-value;" flex="2" editable="true"/>  
  92.         </treecols>
  93.     </tree>
  94.  
  95. </dialog>
  96.